package com.zxx.coolweather._wuguan2.queue_prority;

/**
 * @author zxx on 2022/1/12
 */
public class Main {

    public void start() {
        // 第一种，先进先出的队列
        YolandaLinkedQueue queue = new YolandaLinkedQueue(3);
        queue.start();

        // 第二种，没有顺序的队列
        //YolandaQueue queue1 = new YolandaQueue(1);
        //queue1.start();

        for (int i = 0; i < 20; i++) {
            Request request = new Request("请求" + i);
            if (i == 10) {
                request.setPriority(Priority.C);
            }
            if (i == 15) {
                request.setPriority(Priority.D);
            }
            queue.add(request);
//            queue1.add(request);
        }
    }

    public static void main(String[] args) {
        Main main = new Main();
        main.start();
    }

}
